#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 2e5 + 10;
const int MOD = 1e9 + 7;

int n, m;
ll k;
ll a[MAXN];

vector<int> g[MAXN];

int in[MAXN];
bool vis[MAXN];
int dp[MAXN];
// 建一个新图
vector<int> g2[MAXN];
unordered_set<int> s;


// if exists path which max number of it <= x
bool check(int x) {
    s.clear();
    for (int i = 1; i <= n; i++) {
        in[i] = vis[i] = dp[i] = 0;
        g2[i].clear();
        if (a[i] <= x) s.insert(i), dp[i] = 1;
    }
    for (int i = 1; i <= n; i++) {
        for (auto j : g[i]) {
            if (s.find(i) != s.end() && s.find(j) != s.end()) {
                g2[i].push_back(j);
                in[j]++;
            }
        }
    }


    queue<int> q;
    for (int i = 1; i <= n; i++) {
        if (s.find(i) != s.end() && !in[i]) q.push(i);
    }

    while (!q.empty()) {
        int j = q.front();
        q.pop();
        vis[j] = true;

        if (dp[j] >= k) return true;
        for (auto u : g2[j]) {
            if (!vis[u]) {
                dp[u] = max(dp[u], dp[j] + 1);
                if (dp[u] >= k) return true;
                in[u]--;
                if (!in[u]) q.push(u);
            }
        }
    }

    for (int i = 1; i <= n; i++) {
        if (s.find(i) != s.end() && in[i]) return true;
    }
    return false;
}

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> n >> m >> k;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
    }

    ll l = 0, r = 1e9;
    while (l < r) {
        ll mid = l + r >> 1;
        if (check(mid)) r = mid;
        else l = mid + 1;
    }

    // cout << l << endl;
    if (check(l))cout << l << endl;
    else cout << -1 << endl;

    return 0;
}